<template>
    <div>
        <r-search :searchForm="searchForm" :searchHandle="searchHandle" :searchData="searchData" />
        <r-table :isPagination="true" :tableData="tableData" :tableCols="tableCols" :tablePage="tablePage" @refresh="init()"></r-table>
        <!-- <r-form :formRules="formRules" :formHandle="formHandle" :formData="formData" :formCols="formCols" ref="elForm" labelWidth="100px" dialogWidth="500px" :isHandle="true" /> -->
    </div>
</template>
<script>
export default {
    data() {
        return {
            searchData: {
                sType: '2'
            },
            searchForm: [
                {
                    type: 'input',
                    prop: 'number',
                    placeholder: '订单编号',
                    width: 150
                },
                {
                    type: 'input',
                    prop: 'name',
                    placeholder: '下单用户',
                    width: 150
                },
                {
                    type: 'select',
                    prop: 'state',
                    placeholder: '订单状态',
                    width: 150,
                    options: [
                        {
                            label: '审核通过',
                            value: '1'
                        },
                        {
                            label: '审核不通过',
                            value: '2'
                        },
                        {
                            label: '待审核',
                            value: '3'
                        },
                    ]
                },
                {
                    type: 'date',
                    prop: 'etime',
                    placeholder: '提交时间',
                    width: 170,
                    options: [
                    ]
                },
            ],
            searchHandle: [
                {
                    label: '搜索',
                    type: 'success',
                    icon: 'el-icon-search',
                    handle: e => this.init()
                },
                {
                    label: '重置',
                    icon: 'el-icon-refresh-right',
                    handle: e => this.searchFromReset()
                }
            ],
            tableData: [

            ],
            tableCols: [
                {
                    label: '订单编号',
                    prop: 'number',
                    // theme: e => e.status ? 'primary' : 'danger', type: "tag",
                },
                {
                    label: '提交时间',
                    prop: 'createdTime',
                },
                {
                    label: '用户名',
                    prop: 'name',
                },
                {
                    label: '手机号码',
                    prop: 'phone'
                },
                {
                    label: '提现金额',
                    prop: 'money'
                },
                {
                    label: '到账方式',
                    prop: 'type',
                    formatter: e => e.type == 1 ? '银行卡' : e.type == 2 ? '微信' : e.type == 3 ? '支付宝' : ''
                },
                {
                    label: '账户资料',
                    prop: 'bankInfo',
                    formatter:e=>e.bankInfo&&JSON.parse(e.bankInfo).bankCard
                },
                {
                    label: '订单状态',
                    prop: 'state',
                    formatter: e => e.state == 1 ? '审核通过' : e.state == 2 ? '审核不通过' : '待审核'
                }
            ],
            tablePage: { limit: 10, page: 1, total: 0 },

        };
    },
    components: {},
    computed: {},
    mounted() {
        this.init()
    },
    methods: {
        async init() {
            let param = { ...this.searchData, ...this.tablePage }
            let res = await this.api.takecashList(param)
            if (res) {
                this.tablePage.total = res.data.total
                this.tableData = res.data.list
            }
        },
        //查询
        elFormSubmit() {

        },
        goDetail() {
            this.$router.push('/saleServe-Detail')
        }
    }
};
</script>
<style scoped lang='scss'>
.el-icon-search {
  margin-right: 10px;
}
</style>